<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.111cn.net/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>网页登录中实现记住用户名和密码的功能（完成自动登录）</title>
</head>
<body>
<?





$uid = @$_COOKIE['uid'];
$pwd = @$_COOKIE['uid'];
if( $uid !=''  && $pwd !='' )
{
 //sql数据库查询验证
 echo 3;
 @$_SESSION['uid'] ='abc';
}
if( $_SESSION['uid'] )
{
 echo '会员中心，发表文章，到http://www.111cn.net去玩';
}
else
{
?>
<form id="form1" name="form1" method="post" action="al2">
  <p>
    <label for="uid"></label>
    <input type="text" name="uid" id="uid" />
  </p>
  <p>
    <label for="pwd"></label>
    <input type="text" name="pwd" id="pwd" />
  </p>
  <p>
    <input type="checkbox" name="checkbox" id="checkbox" value="7" />
    <label for="checkbox"></label>
    一周内不用登录
  </p>
  <p>
    <input type="submit" name="button" id="button" value="登录" />
  </p>
  <p>&nbsp;</p>
</form>
<?
}
?>
</body>
</html>